﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace dotNails.CodeGen.Util {
	public class FileUtil {
		public static string GetFolderPath(string filePath) {
			FileInfo info = new FileInfo(filePath);
			return info.Directory.FullName;
		}

		public static void CreateFileFromString(string fullFilePath, string fileContent) {
			if (fullFilePath.Length > 0 && fileContent.Length > 0) {
				using (StreamWriter writer = new StreamWriter(fullFilePath, false)) {
					writer.Write(fileContent);
					writer.Flush();
					writer.Close();
				}
			}
		}
	}
}
